home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / languages / cleo.lzh / Cleo / doc / english.doc < prev    next >
Encoding:
Text File  |  1993-01-24  |  6.2 KB  |  230 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                                 OVERVIEW OF
  7.                                    CLEO
  8.                             Programming Language
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15. Version:        1.00 (Dec 1992)
  16. Author :        DIALLO Barrou
  17.  
  18.  
  19. Introduction
  20.  
  21.     This work consists in a Pascal-like experimental programming language
  22. including some 3d and 2d mathematical stuffes to generate 3D scenes for a
  23. soon coming ray-tracer.
  24.     This version includes loop-instructions, standard I/O controls,
  25. expressions tests, floating point numbers, special 3d/2d types.
  26.  
  27. Package Contents:
  28.  
  29.     cleo:/
  30.     Author              (Author's name & Adress , Copyright advertissement)
  31.     makefile                       (Compiling rules to Amiga users)
  32.     /bin
  33.         cleo                        (Executable-code Encoder)
  34.         inter                       (Interpreter program)
  35.     /etc
  36.        Cleo_exe_cfg                 (Interpreter Configuration file)
  37.        Cleo_int_cfg                 (Encoder Configuration file)
  38.     /cleobin                        (Cleo's executable-code files)
  39.         cleo.out                    (Default Cleo's executable-code)
  40.     /include                        (Encoder's include source files)
  41.     /source                         (Encoder's code source files)
  42.     /obj                            (Object.o files)
  43.     /examples                       (Some demo samples)
  44.     /inter
  45.         makefile                        (Compiling rules to Amiga users)
  46.         /include                        (Interpreter's include source files)
  47.         /source                         (Interpreter's code source files)
  48.  
  49.  
  50. How can I recompile the Encoder and the interpreter?
  51.  
  52.  
  53.     On Amiga machines:  ( Release 1.3 , 2.0 or 3.0)
  54.  
  55.     1. Assign the cleo: directory
  56.         Assign cleo: my_dir
  57.  
  58.     2. add a path to the interpreter and compiler:
  59.         path cleo:bin add
  60.  
  61.     Ensure that you've got the Aztec C v5.01 compiler and the make command
  62.     on your disk and type this.
  63.  
  64.     3. Edit these files : CLEO:makefile and CLEO:inter/makefile to change
  65.         the path behind PROJET =
  66.  
  67.     4. Under your Shell type please:
  68.  
  69.         cd cleo:
  70.         make
  71.         cd inter
  72.         make
  73.         cd /
  74.     And then if no errors occurs, you've got two executable files in the bin
  75.     directory.
  76.  
  77.  
  78. How can I compile and run a cleo program?
  79.  
  80.     The easiest way to show how cleo works, is to compile a sample in the
  81. Examples directory:
  82.     (type what's following)
  83.  
  84.     1>  cleo examples/hello.cl
  85.  
  86.     This will compile the hello.pas sample which stay the Examples
  87.     directory. The default output file (etc/cleobis.out) is used to put
  88.     the produced cleo-code.
  89.  
  90.     1> inter
  91.                     (This will execute the default cleo-code)
  92.  
  93.  
  94.  
  95. Types:
  96.         Types lenght depends to the machine on which Cleo was compiled.
  97.  
  98.         1. LONGREAL                     ( = double in C language)
  99.         2. REAL                         ( = float in C language)
  100.         3. LONGINT                      ( = long int in C language)
  101.         4. INTEGER                      ( = int in C language)
  102.         5. CHAR                         ( = char in C language)
  103.         6. STRING
  104.             ex:
  105.                  str : STRING;
  106.                  str2 : STRING;
  107.  
  108.                  str := 'Hello World!' ;
  109.  
  110.                  str2 : =str;
  111.                  writeln(str2);
  112.  
  113.         7. BOOLEAN                      ( = 1 unsigned byte )
  114.         8. POINT2D                      ( = 2 floats in C language)
  115.             ex:
  116.                 pnt    :   POINT3D;
  117.  
  118.                 pnt.x := 111;      pnt.y := 222;
  119.                 writeln( ' coords(x y) =' , pnt.x, '  ', pnt.y  );
  120.  
  121.         9. POINT3D                      ( = 3 floats in C language)
  122.             ex:
  123.  
  124.                 pnt1, pnt2 : POINT3D;
  125.  
  126.                 pnt1.x := 111;      pnt1.y := 222;      pnt1.z := 333;
  127.                 pnt2 := pnt1;
  128.                 writeln(' y= ', pnt2.y);
  129.  
  130.         10. RGB                      ( = 3 unsigned char in C language)
  131.             ex:
  132.                 col :  RGB;
  133.  
  134.                 col.r := 111;      col.g := 222;      col.b := 333;
  135.                 writeln(' red = ', col.r);
  136.  
  137.         11. ARRAY  ...   OF CHAR, OF INTEGER, OF REAL, OF BOOLEAN,
  138.                         OF POINT3D, OF POINT2D, OF RGB.
  139.  
  140. Mathematical operators:
  141.  
  142.     +, -, /, * .
  143.     % , mod : modulo
  144.  
  145. Logical operators:
  146.  
  147.     And, Or, Xor.
  148.  
  149.  
  150. Operators priority:
  151.  
  152.     (High priority)
  153.     * / AND MOD DIV
  154.     + - OR
  155.     < <= => > <>
  156.  
  157. Mathematical functions:
  158.  
  159.    abs , atan, acos, asin, cosh, sinh,
  160.    cos, sin, exp, ln, sqr,
  161.    sqrt, inv, rnd, tan, tanh,
  162.  
  163. Extra functions:
  164.  
  165.     odd(x)      :   return 1 if x is an odd value
  166.                         else return 0
  167.     even(x)     :   return 1 if x is an even value
  168.                         else return 0
  169.     pred(x)     :   return the predececor of x
  170.     succ(x)     :   return the successor of x
  171.     int(x)      :   return the integer part of x
  172.     frac(x)     :   return the floating part of x
  173.  
  174. Break Instructions:
  175.  
  176.     1. WHILE expression DO instruction;
  177.     2. REPEAT instruction UNTIL expression;
  178.  
  179.  
  180. Tests Instructions:
  181.  
  182.     1. IF expression THEN instruction; <ELSE instruction;>
  183.  
  184.  
  185. I/O Functions:
  186.  
  187.     1. Output functions:
  188.  
  189.     1.1. WRITE ( EXPRESSION | CONSTANTS ...);
  190.     1.2. WRITELN < (EXPRESSION | CONSTANTS) ...> | <;>
  191.  
  192.     Write and Writeln are the same functions. Writeln just prints out a
  193.     carriage return at the end of line.
  194.     A Writeln function alone (without arguments) stands for a carriage
  195.     return.
  196.  
  197.     2. Input functions:
  198.  
  199.     2.1. READ ( variable, variable, ...);
  200.     2.2. READLN ( variable, variable, ...);
  201.  
  202.  
  203.  
  204. Porting Conventions:
  205.  
  206.     This language was developped with Aztec C 5.01 on Commodore Amiga and
  207. entirely written in C language. It can be compiled on UNIX* Workstations or
  208. on IBM PC/XT/AT by #defining during compilation 'unix' or 'msdos'.
  209.  
  210.  
  211. Known bugs:
  212.  
  213.     1. Types conversions are not yet implemented, no errors or warning will
  214. occurs when you attempt to assign a real to an integer variable!
  215.     2. Array under-overflow aren't ckecked.
  216.     3. Arrays fisrt index must be 1.
  217.  
  218. Author:
  219.  
  220. Please help me to improve new versions of Cleo,
  221.     send please bug reports, or suggestions to :
  222.  
  223.     DIALLO Barrou
  224.     23, rue des enfants de choeur
  225.     51210 MONTMIRAIL
  226.     FRANCE
  227.  
  228. *UNIX is a trademark of AT&T Bell Laboratories.
  229.  
  230.